home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
422mods.zip
/
AFG_TCLR.422
< prev
next >
Wrap
Text File
|
1993-04-07
|
4KB
|
143 lines
COLORS.MOD puts colors anywhere
The False Prophet #604 @12456
3Wednesday, March 31, 1993 1 7:41 am
R
28/43: AFG_TCLR.MOD
Name: Alken Foijet Godden #1 @8860 [S. Pasadena, CA]
Date: Mon Aug 24 21:59:43 1992
From: Waterfall [GSA] (Southern California) [818-799-3544]
Mod Name : AFG_TCLR.MOD
Writer : Alken Foijet Godden
WWIV ver : WWIVv421... should work with any though.
Description: Allows colors almost anywhere {titles, etc.}.
Ok, here's what this mod "really" does: Allow you to put colors
everywhere! Be a bit carefull when using this mod to have colors in places
that are dependant on alignnment (EX: in //BOARDEDIT your subs will tend to
get out of alignment when you add color the the sub names).
You'll be able to put color in your voting questions and answers, sub
names, directory names, G-File names, message titles, etc... If you have
fancy boxes around what you want colorize I suggest that you use wherex() and
wherey() to help with your alignment in that area.
Replace the following void with the one that's in COM.C and compile...
-----------------------------------------------------------------------
void input1(char *s, int maxlen, int lc, int crend)
/* This will input a line of data, maximum maxlen characters long, terminated
* by a C/R. if (lc) is non-zero, lowercase (and color) is allowed,
* otherwise all characters are converted to uppercase.
*/
{
int curpos=0, done=0, in_ansi=0, colorcheck=0;
unsigned char ch;
while (!done && !hangup) {
ch = getkey();
if (in_ansi) {
if ((in_ansi==1) && (ch!='['))
in_ansi=0;
else {
if (in_ansi==1)
in_ansi=2;
else if (((ch<'0') || (ch>'9')) && (ch!=';'))
in_ansi=3;
else
in_ansi=2;
}
}
if (!in_ansi) {
if (ch > 31) {
if (curpos < maxlen) {
if (!lc)
ch = upcase(ch);
if (colorcheck==0) {
s[curpos++] = ch;
outchr(ch);
} else if (ch<58 && ch>47) {
s[curpos++] = ch;
outchr(ch);
colorcheck=0;
} else {
backspace();
curpos--;
colorcheck=0;
}
}
} else
switch(ch) {
case 14:
case 13:
s[curpos] = 0;
done = echo = 1;
if (crend)
nl();
break;
case 16: /* Ctrl-P */
if (curpos < maxlen && lc==1) {
ch = 3;
s[curpos++] = ch;
colorcheck = 1;
outchr(ch);
}
break;
case 23: /* Ctrl-W */
if (curpos) {
do {
curpos--;
backspace();
if (s[curpos]==26)
backspace();
} while ((curpos) && (s[curpos-1]!=32));
}
break;
case 26:
if (input_extern) {
s[curpos++] = 26;
outstr("^Z");
}
break;
case 8:
if (curpos) {
if (s[curpos-2]==3) {
curpos--;
curpos--;
break;
}
curpos--;
backspace();
if (s[curpos] == 26)
backspace();
}
break;
case 21:
case 24:
while (curpos) {
curpos--;
backspace();
if (s[curpos] == 26)
backspace();
}
break;
case 27:
in_ansi=1;
break;
}
}
if (in_ansi==3)
in_ansi=0;
}
if (hangup)
s[0] = 0;
}
--------------------------------------------------------------------
Yep, it's that simple... enjoy.
Ωlkën
Fσíjeτ